/**
 * rest参数
 * 
 * 
 */

/***
 * numa : number 
 * numb : number 
 * ohters ： Array
 */
function sum(numa, numb, ...ohters) {
    console.log("ohters", ohters);
    let result = 0;
    result = (numa + numb)

    //SHIFT + ALT + F 格式化
    for (let i = 0; i < ohters.length; i++) {
        // result  =  result +  ohters[i]
        result += ohters[i]
    }
    console.log("result", result);

}

sum(10, 20, 30, 40)